using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Threading;
using System.Runtime.InteropServices;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;

namespace MultiVMR9cs
{
    public class CloneSource : VideoSource
    {
        internal VideoSource _clonedSource;

        public CloneSource(MultiVMR9Renderer parentRenderer, VideoSource clonedSource)
            : base(parentRenderer)
        {
            _clonedSource = clonedSource;

            // create the default 3d mesh
            InitVertices();
        }

        public VideoSource ClonedSource
        {
            get
            {
                return _clonedSource;
            }
        }

        public override Texture Texture
        {
            get
            {
                return _clonedSource.Texture;
            }
        }

        public override Size TextureSize
        {
            get
            {
                return _clonedSource.TextureSize;
            }
        }

        public override void OnDeviceLost()
        {
            // we have no DirectX resources in the Default pool
        }

        public override void OnDeviceReset()
        {
            // we have no DirectX resources in the Default pool
        }

        public override int OnDraw()
        {
            return DrawDefaultMesh(_clonedSource.Texture);
        }

        public override void Dispose()
        {
            // we have nothing to dispose
        }
    }
}
